import request from '@/utils/request'
import qs from 'qs'

export function addEBookApi(form) {
  return request({
    url: `/ebook`,
    method: 'post',
    data: form
  })
}
export function getEBookApi(id) {
  return request({
    url: `/ebook/${id}`,
    method: 'get'
  })
}
export function getEBooksApi(pageNo, pageSize, ebook) {
  return request({
    url: `/ebook?${qs.stringify(ebook)}`,
    params:{
      pageNo: pageNo,
      pageSize: pageSize,
    },
    method: 'get'
  })
}

export function delEBookApi(id) {
  return request({
    url: `/ebook/${id}`,
    method: 'delete'
  })
}
export function delEBooksApi(ebooks) {
  return request({
    url: `/ebook`,
    data:ebooks,
    method: 'delete'
  })
}
export function updateEBookApi(form) {
  return request({
    url: `/ebook`,
    method: 'put',
    data:form
  })
}
